local ChatManCell = class("ChatManCell")

function ChatManCell:ctor()
end

function ChatManCell:start()
    self._btnName.onClick:AddListener(handler(self, self._onPanelTouchClick))
end

function ChatManCell:updateUI(data, selectedId)
    self._data = data
    self._textName.text = data.name
    self._imageSelected:SetActive(self._data.userId == selectedId)
end

function ChatManCell:_onPanelTouchClick()
    if not self._data then
        return
    end
    if self.customCallback then
        self.customCallback()
    end
end

return ChatManCell
